﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAO;
using DTO;
using System.Data;
namespace BUS
{
    public class BaoCaoTon_BUS
    {

        private static BaoCaoTon_BUS m_instance = null;

        public static BaoCaoTon_BUS Instance
        {
            get
            {
                if (m_instance == null)
                    m_instance = new BaoCaoTon_BUS();
                return m_instance;
            }
        }

        /// <summary>
        ///   them bao cao cong ton
        ///   
        /// </summary>
        /// 

        public bool ThemBaoCaoTOn(BaoCaoTon_DTO _item)
        {
            return BaoCaoTon_DAO.Instance.ThemBaoCaoTon(_item.NgayBaoCao);
        }

        /// <summary>
        ///   lay ma bao cao cong no
        /// </summary>
        /// 

        public string LayMaBaoCaoCongNo()
        {
            DataTable dt = BaoCaoTon_DAO.Instance.LayMaBaoCaoTon();
            DataRowCollection list = dt.Rows;
            if (list.Count == 0)
            {
                return null;
            }
            DataRow dr = list[0];
            return (string)dr["MaBaoCaoTon"];
        }

       
    }
}
